# 利用extend修改独立对象
module Secretive
	def name
		"[not available]"
	end
end

class Person
	attr_accessor :name
end

david = Person.new
david.name = "David"
matz = Person.new
matz.name = "Matz"
ruby = Person.new
ruby.name = "Ruby"
david.extend(Secretive)
ruby.extend(Secretive)
puts "We've got one person named #{matz.name}." + 
     "one named #{david.name}," +
	 "and one named #{ruby.name}"
	 
module Makers
	def makes
		%w{ Honda Ford Toyota Chevrolet Volvo}
	end
end

class Car
	extend Makers
end

p Car.singleton_class.ancestors
p Car.ancestors
p david.class.ancestors
p Car.makes